package com.azkj.album.view.widgets;

import android.content.Context;
import android.view.View;

import androidx.annotation.NonNull;

import com.azkj.album.R;
import com.lxj.xpopup.core.AttachPopupView;

public class BubbleDialog extends AttachPopupView {
    public BubbleDialog(@NonNull Context context) {
        super(context);
    }

    private CallBackListener callBackListener;

    public void setCallBackListener(CallBackListener callBackListener){
        this.callBackListener = callBackListener;
    }

    @Override
    protected void onCreate() {
        super.onCreate();
        findViewById(R.id.tv_share_all).setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                if (callBackListener != null){
                    callBackListener.callBackAll();
                }
            }
        });
        findViewById(R.id.tv_share_single).setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                if (callBackListener != null){
                    callBackListener.callBackSingle();
                }
            }
        });
    }

    @Override
    protected int getImplLayoutId() {
        return R.layout.dialog_bubble;
    }

    public interface CallBackListener{
        void callBackAll();
        void callBackSingle();
    }
}
